Skip to content

[19.0][MIG] purchase_landed_cost: Migration to version 19.0#3033

Open
Andrii9090-tecnativa wants to merge 59 commits intoOCA:19.0from
Tecnativa:19.0-mig-purchase_landed_cost
Open

[19.0][MIG] purchase_landed_cost: Migration to version 19.0#3033
Andrii9090-tecnativa wants to merge 59 commits intoOCA:19.0from
Tecnativa:19.0-mig-purchase_landed_cost

Conversation

@Andrii9090-tecnativa
Copy link
Copy Markdown
Contributor

Migration to 19.0

@pedrobaeza @victoralmau can you review please?
@Tecnativa
TT61958

pedrobaeza and others added 30 commits April 27, 2026 09:53
… real cost method is selected, and quant cost price adjustment
ernestotejeda and others added 20 commits April 27, 2026 09:53
Invoice currency is NOT being used to convert to landed cost currency.
Currently it takes company currency and converts to landed cost currency, so if invoice is in different currency, amount is wrong.
Now the model is different.

account.invoice > account.move
account.invoice.line > account.move.line

Inverse name: `move_id`, not `invoice_id`

Fixes OCA#1248
Currently translated at 100.0% (138 of 138 strings)

Translation: purchase-workflow-16.0/purchase-workflow-16.0-purchase_landed_cost
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_landed_cost/es/
Currently translated at 42.0% (58 of 138 strings)

Translation: purchase-workflow-16.0/purchase-workflow-16.0-purchase_landed_cost
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_landed_cost/it/
Currently translated at 100.0% (138 of 138 strings)

Translation: purchase-workflow-16.0/purchase-workflow-16.0-purchase_landed_cost
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_landed_cost/it/
Currently translated at 100.0% (138 of 138 strings)

Translation: purchase-workflow-16.0/purchase-workflow-16.0-purchase_landed_cost
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_landed_cost/pt_BR/
Using `read` for bringing act_window values requires super-admin access.
Let's use `_for_xml_id` instead that is a method specially for that.

TT117299
Since odoo/odoo@d0342c8, the default existing company is not getting a
CoA automatically, provoking than the current tests fail with the error:

odoo.exceptions.UserError: No journal could be found in company My Company (San Francisco) for any of those types: sale

Thus, we put tests post-install for being sure localization modules are
installed, the same as AccountTestInvoicingCommon does, but we don't
inherit from it, as it creates an overhead creating 2 new companies and
loading their CoA and some more stuff, while we don't need all of that.

Besides, if you don't have `l10n_generic_coa` installed, you can't use
another CoA (like `l10n_es`) easily, so we put little code to select the
first available CoA.
@OCA-git-bot OCA-git-bot added series:19.0 mod:purchase_landed_cost Module purchase_landed_cost labels Apr 27, 2026
@Andrii9090-tecnativa Andrii9090-tecnativa marked this pull request as draft April 27, 2026 12:54
@Andrii9090-tecnativa Andrii9090-tecnativa force-pushed the 19.0-mig-purchase_landed_cost branch from c79b932 to a5e9d56 Compare April 27, 2026 13:03
@Andrii9090-tecnativa Andrii9090-tecnativa marked this pull request as ready for review April 27, 2026 13:07
@pedrobaeza
Copy link
Copy Markdown
Member

/ocabot migration purchase_landed_cost

@OCA-git-bot OCA-git-bot added this to the 19.0 milestone Apr 30, 2026
@OCA-git-bot OCA-git-bot mentioned this pull request Apr 30, 2026
78 tasks
_description = "Purchase cost type"

name = fields.Char(required=True, translate=True, index=True)
name = fields.Char(required=True, translate=True, index="trigram")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't change this index, as we don't need similar searches.

res = super().default_get(fields_list)
if "possible_picking_ids" in fields_list:
expenses = self.env["purchase.cost.distribution.expense"].search([])
expenses = self.env["purchase.cost.distribution.expense"].browse()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is not correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:purchase_landed_cost Module purchase_landed_cost series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.